{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e4c8f222",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入正确的姓名：xingqian\n",
      "请输入正确的学号：2010102222\n",
      "欢迎xingqian登录成功\n",
      "作为我们尊敬的会员，您还有 9 次查询机会~\n",
      "请输入想要查询的星期：Thursday\n",
      "请输入想要查询的小时：11\n",
      "请输入想要查询的分钟：35\n",
      "您要查询的课表时间为 11:35\n",
      "近现代中外政治与文化交流【黄家瑜】\n",
      "\n",
      "请输入正确的姓名：xingqian\n",
      "请输入正确的学号：2010102222\n",
      "欢迎xingqian登录成功\n",
      "作为我们尊敬的会员，您还有 8 次查询机会~\n",
      "请输入想要查询的星期：Friday\n",
      "请输入想要查询的小时：9\n",
      "请输入想要查询的分钟：55\n",
      "您要查询的课表时间为 9:55\n",
      "网站运营与管理【胡美香】\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# 优化课程表，增加用户输入\n",
    "\n",
    "\n",
    "# 存储时间数据\n",
    "# 假定输入学号在2010000000到2020000000范围内为会员，否则为非会员\n",
    "\n",
    "week_data = [\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\"]\n",
    "\n",
    "# 运用while循环，控制会员与非会员的使用次数\n",
    "# 利用int将输入学号转为数值\n",
    "\n",
    "count = 11\n",
    "while True:\n",
    "    count -= 1\n",
    "    \n",
    "    # 用户登录输入信息\n",
    "    username = input(\"请输入正确的姓名：\")\n",
    "    password = input(\"请输入正确的学号：\")\n",
    "    num = int(password)\n",
    "    \n",
    "    # 判断用户属性是否为会员\n",
    "    if 2010000000 < num < 2020000000:\n",
    "        # 会员使用次数为10\n",
    "        if count == 0:\n",
    "            print(\"您好，您的使用次数已用完~\")\n",
    "            break\n",
    "        elif 0 < count < 11:\n",
    "            print(\"欢迎%s登录成功\"%(username))\n",
    "            print(\"作为我们尊敬的会员，您还有\",count-1,\"次查询机会~\")\n",
    "                \n",
    "    # 非会员使用次数为5次\n",
    "    else:\n",
    "        if count == 6:\n",
    "            print(\"您好，您的使用次数已用完~\")\n",
    "            break\n",
    "        else:   \n",
    "            print(\"欢迎%s登录成功\"%(username))\n",
    "            print(\"作为普通用户，您还有\",count-6,\"次查询机会~\")\n",
    "                \n",
    "    # 输入要查询的星期            \n",
    "    week_time = input(\"请输入想要查询的星期：\")\n",
    "    \n",
    "    # 输入要查询的时间\n",
    "    hour = input(\"请输入想要查询的小时：\")\n",
    "    minute = input(\"请输入想要查询的分钟：\")\n",
    "    time = int(hour + minute)\n",
    "    \n",
    "    print(\"您要查询的课表时间为 {}:{}\".format(hour, minute))\n",
    "    \n",
    "    # 判断输入的星期是否符合在范围内\n",
    "    if week_time in week_data:\n",
    "        if week_time == \"Monday\":\n",
    "            \n",
    "            # 判断输入时间范围\n",
    "            # 为了方便输入，利用整数格式代替时间格式\n",
    "            if 945 < time < 1200:\n",
    "                print(\"创业基础（实践）【廖汉腾】\")\n",
    "            elif 1430 < time < 1655:\n",
    "                print(\"python语言【许智超】\")\n",
    "            else:\n",
    "                print(\"Rest time\")\n",
    "\n",
    "            \n",
    "        elif week_time == \"Tuesday\":\n",
    "            if 800 < time < 930:\n",
    "                print(\"毛概（实践）【李婧】\")\n",
    "            elif 1610 < time < 1735:\n",
    "                print(\"大英【王金妮】\")\n",
    "            elif 2015 < time < 2145:\n",
    "                print(\"非物质文化遗产赏析【唐剑宇】\")\n",
    "            else:\n",
    "                print(\"Rest time\")\n",
    "\n",
    "        elif week_time == \"Wednesday\":\n",
    "            if 1035 < time < 1200:\n",
    "                print(\"无线电测向【梁嘉敏】\")\n",
    "            elif 1845 < time < 2055:\n",
    "                print(\"毛概【李文】\")\n",
    "            else:\n",
    "                print(\"Rest time\")\n",
    "\n",
    "        elif week_time == \"Thursday\":\n",
    "            if 1035 < time < 1200:\n",
    "                print(\"近现代中外政治与文化交流【黄家瑜】\")\n",
    "            elif 1430 < time < 1555:\n",
    "                print(\"广告文案写作【罗希】\")\n",
    "            elif 1845 < time < 2010:\n",
    "                print(\"大英【王金妮】\")\n",
    "            else:\n",
    "                print(\"Rest time\")\n",
    "\n",
    "        elif week_time == \"Friday\":\n",
    "            if 800 < time < 930:\n",
    "                print(\"AI软件运用【阚凤霞】\")\n",
    "            elif 945 < time < 1200:\n",
    "                print(\"网站运营与管理【胡美香】\")\n",
    "            else:\n",
    "                print(\"Rest time\")\n",
    "            \n",
    "    else:\n",
    "        print(\"听说今天是周末\")   \n",
    "    print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "647bcf34",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
